package com.hx.xiao.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hx.xiao.entity.Su;
import com.hx.xiao.entity.Users;
import com.hx.xiao.mapper.UsersMapper;
import com.hx.xiao.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hx
 * @since 2024-03-21
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {

    @Autowired
    private UsersMapper usersMapper;



    @Override
    public Users getUserPhone(String phone) {
       return usersMapper.getByPhone(phone);
    }

    @Override
    public Users selectSuByid(Integer id) {
        return usersMapper.selectById(id);
    }

    @Override
    public int addPhone(Users users) {
        return usersMapper.insert(users);
    }

    @Override
    public int updateB(Users users) {
        return usersMapper.updateB(users);
    }

    @Override
    public int deleteB(Integer id) {
        return usersMapper.deleteB(id);
    }

    @Override
    public Users findB(Integer id) {
        return usersMapper.findB(id);
    }

    @Override
    public Users findBy(String username,String komh) {
        return usersMapper.findBy(username,komh);
    }

    @Override
    public List<Users> findAll() {
        List<Users> all = usersMapper.findAll();
        return all;
    }

}
